package controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

//@Controller
@RestController
@RequestMapping("/response")
public class ResponseController {
    @RequestMapping("/f1")
    public String f1(){
        System.out.println("f1...");
        return "login";
    }

    @RequestMapping("/f2")
    public ModelAndView f2(){
        System.out.println("f2...");
        ModelAndView mav=new ModelAndView();
        mav.setViewName("login");
        return mav;
    }

    @RequestMapping("/f3")
    public void f3(){
        System.out.println("f3...");
    }

    @RequestMapping("/f5")
    public String f5(){
        return "<h1>Hello1</h1>";
    }

    @RequestMapping("/f6")
    @ResponseBody
    public String f6(){
        return "<h1>Hello2</h1>";
    }

    @RequestMapping("/f7")
    public @ResponseBody String f7(){
        return "<h1>Hello3</h1>";
    }
}
